#include <iostream>
#include <vector>

void parseStr(std::string str, std::vector<std::vector<double>> &a,
              std::vector<int> &x, std::vector<double> &b, std::vector<std::string> &sign)

{
    std::vector<std::string> tmp_vec;
    int i = 0;
    while (i < str.size())
    {
        std::string tmp_str;
        while (i < str.size() && str[i] != ',' && str[i] != ';')
        {
            tmp_str.push_back(str[i]);
            i++;
        }
        tmp_vec.push_back(tmp_str);
        i++;
    }

    for (int i = 0; i < 3; i++)
    {
        std::vector<double> a_tmp;
        for (int j = 0; j < 5; j++)
        {
            a_tmp.push_back(std::stod(tmp_vec[i * 5 + j]));
        }
        a.push_back(a_tmp);
    }

    for (int i = 0; i < 5; i++)
    {
        x.push_back(std::stoi(tmp_vec[15 + i]));
    }

    for (int i = 0; i < 3; i++)
    {
        b.push_back(std::stod(tmp_vec[20 + i]));
    }

    for (int i = 0; i < 3; i++)
    {
        sign.push_back(tmp_vec[23 + i]);
    }
}

int main()
{
    std::string str;
    std::cin >> str;

    std::vector<std::vector<double>> a;
    std::vector<int> x;
    std::vector<double> b;
    std::vector<std::string> sign;

    parseStr(str, a, x, b, sign);

    double max_df = -1e10;
    bool right = true;
    for (int i = 0; i < 3; i++)
    {
        double l = a[i][0] * x[0] + a[i][1] * x[1] + a[i][2] * x[2] + a[i][3] * x[3] + a[i][4] * x[4];
        if (sign[i] == ">")
        {
            if (l <= b[i])
                right = false;
        }
        else if (sign[i] == ">=")
        {
            if (l < b[i])
                right = false;
        }
        else if (sign[i] == "<")
        {
            if (l >= b[i])
                right = false;
        }
        else if (sign[i] == "<=")
        {
            if (l > b[i])
                right = false;
        }
        else if (sign[i] == "=")
        {
            if (l != b[i])
                right = false;
        }

        double diff = l - b[i];
        if (max_df < diff)
        {
            max_df = diff;
        }
    }

    if (right)
        std::cout << "true" << " " << (int)max_df << std::endl;
    else
        std::cout << "false" << " " << (int)max_df << std::endl;

    return 0;
}